﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;


namespace integrationServer
{
    public class User
    {
        /// <summary>
        /// this class to define a user
        /// </summary>
        #region statement
        private string _nomUser;
        private string _pseudo;
        private string _passWord;
        public string url;
        #endregion

        public User() 
        { 
        }

        public User(string nomUser, string pseudo, string passWord,string url)
        {
            fullName = nomUser;
            name = pseudo;
            PassWord = passWord;
            url = url + name;
        }

        #region get and set of user information 
        public string fullName
        {
            get
            {
                if (_nomUser.Length == 0)
                    throw new Exception("NomUser improperly initialized");
                return _nomUser;
            }
            set
            {
                if (value == null || value.Length == 0)
                    throw new ArgumentException("NomUser cannot be null or empty");
                _nomUser = value;
            }
        }

        public string name
        {
            get
            {
                if (_pseudo.Length == 0)
                    throw new Exception("Pseudo improperly initialized");
                return _pseudo;
            }
            set
            {
                if (value == null || value.Length == 0)
                    throw new ArgumentException("Pseudo cannot be null or empty");
                _pseudo = value;
            }
        }

        public string PassWord
        {
            get
            {
                if (_passWord.Length == 0)
                    throw new Exception("PassWord improperly initialized");
                return _passWord;
            }
            set
            {
                if (value == null || value.Length == 0)
                    throw new ArgumentException("PassWord cannot be null or empty");
                _passWord = value;
            }
        }
        #endregion
    }
}
